<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$websetup.webname}</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/index.css" />
<script type="text/javascript" src="__PUBLIC__/userjs/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/userjs/jquery.galleria.js"></script>
<script type="text/javascript" src="__PUBLIC__/userjs/tabset.js"></script>
<load href="__PUBLIC__/Js/utils.js"/>
<script>
function share(){
  var txt="{:server_url()}"+"/index.php/Product/pr_info/id/"+"{$Think.get.id}";
  var webname="{$websetup.webname}";
  copyToClipboard(txt,webname);
}
function comment(){
	setTab4('fo',2,2);
	location.href="__SELF__"+"#comment";
}

//检测商品评论表单
function check_pr_comment(theform){
	if(theform.email.value==''){
		alert('用户名不能为空');
		theform.email.focus();
		return false;
	}
	if(theform.comment_title.value==''){
	   alert('标题不能为空');
	   theform.comment_title.focus();
	   return false;	
	}
	if(theform.content.value==''){
	   alert('评论内容不能为空');
	   theform.content.focus();
	   return false;
	}
	return true;
	theform.btn_comment.disabled=true;
}
//ajax分页
function ajax_divpage(pagenum){
	var pr_id  = parseInt("{$Think.get.id}");
	$.ajax({
		type:"GET",
		cache:false,
		async:false,
		dataType:"json",
		data:"pr_id="+pr_id+"&go_page="+pagenum,
		url:"__URL__/ajax_get_comment",
		success:function(msg){
			var msg=eval(msg);
			$("#comment_list").html(msg.prc_list);
			$("#divpage").html(msg.divpage);
		}
	});
	
}
</script>
</head>

<body>
<!-- layout::Home:Public:top::0 -->
<div class="all_div mt8">
	<div>当前位置：首页&nbsp;&gt;&nbsp;<span id="site_tit">产品详细</span></div>
	<div class="clearfix">
		<div class="fl_l w187">
			<div class="ind_pro_tit"><a href="{:U('Hotpro/index')}">热销商品</a></div>
			<div class="vl_main">
				<ul class="vl_pro_hot">
                   <volist name="left_hot6" id="vo">
                    <li>
						<div class="tut"><a href="{:U('Product/pr_info/id/'.$vo['id'])}"><img src="__ROOT__/{$vo.pr_list_pic}" width="160" height="203" border="0" alt=""></a></div>
						<h2><a href="">{$vo.pr_name}</a></h2>
						市场价<span class="pro_old_mon">￥{$vo.pr_market_price}</span><span>售价:￥</span><span class="pro_num">{$vo.pr_shop_price}</span>
						<div class="ind_saled">{$vo.saled_num}</div>
					</li>
                   </volist>
				</ul>
			</div>
		</div>
		<div class="fl_l ml10 w763">
			<div style="padding:10px;border:#ccc solid 1px;">
				<div class="clearfix">
					<div class="fl_l">
	<script type="text/javascript">
	
	$(document).ready(function(){
		$('.gallery_demo_unstyled').addClass('gallery_demo'); // adds new class name to maintain degradability
		$('ul.gallery_demo').galleria({
			history   : true, 
			clickNext : true, 
			insert    : '#main_image',
			onImage   : function(image,caption,thumb) { 
				image.css('display','none').fadeIn(1000);
				caption.css('display','none').fadeIn(1000);
				var _li = thumb.parents('li');
				_li.siblings().children('img.selected').fadeTo(500,1);
				thumb.fadeTo('fast',1).addClass('selected');
				image.attr('title','Next image >>');
			},
			onThumb : function(thumb) {				
				var _li = thumb.parents('li');
				var _fadeTo = _li.is('.active') ? '1' : '1';
				thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
				thumb.hover(
					function() { thumb.fadeTo('fast',1); },
					function() { _li.not('.active').children('img').fadeTo('fast',1); } 
				)
			}
		});
	});
	
	</script>
						<div class="demo">
						<div id="main_image"></div>
						<ul class="gallery_demo_unstyled">
                           <volist name="pr_pics_arr.pic" id="vo">
                             <eq name="key" value="0">
                               <li class="active"><img src="__ROOT__/{$vo}"  title="{$pr_pics_arr['text'][$key]}"></li>
                             <else/>
                               <li><img src="__ROOT__/{$vo}"  title="{$pr_pics_arr['text'][$key]}"></li>
                             </eq>
                           </volist>
						</ul>
						<div class="nav"><a href="#" onclick="$.galleria.prev(); return false;" class="fl_l"><img src="__PUBLIC__/images/home/left.gif" width="6" height="10" border="0" alt=""></a><a href="#" onclick="$.galleria.next(); return false;" class="fl_r"><img src="__PUBLIC__/images/home/right.gif" width="6" height="10" border="0" alt=""></a></p>
						</div>
						</div>
					</div>
					<div class="fl_r v_pro_sx">
						<h2><a href="">{$pr_info.pr_name}</a></h2>
                        <volist name="pr_attr_list" id="vo">
                          <div class="clearfix v_pro_xx">
                             <volist name="vo" id="v" key="child">
                               <eq name="child" value="1">
                                 <div class="fl_l">{$v.attr_name}： {$v.attr_value}</div>                             
                                <else/>
                                  <div class="fl_r">{$v.attr_name}： {$v.attr_value}</div>                              
                                </eq>
                                
                             </volist>
                          </div>
                        </volist>
						<div class="v_pro_xx">窗纱型号：{$pr_info.pr_sn}</div>
						<div class="v_pro_xx">市 场 价：<span class="old_sale">￥{$pr_info.pr_market_price}</span><br />售&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp价：<span class="new_sale">￥{$pr_info.pr_shop_price}</span></div>
						<form method="post" action="{:U('Cart/pre_detail/pr_id/'.$_GET['id'])}">
						<div class="v_pro_xx2">购买数量：<input type="text" name="buy_num"  id="buy_num" value="1" class="sale_num"></div>
						<div class="v_pro_xx2"><input type="Submit" value="" onclick="" class="buy_btn"></div>
						</form>
					</div>
				</div>
				<div class="clearfix mt8">
					<div class="fl_l">
						<ul class="view_p_lm clearfix">
							<li id="fo1" class="on_view" onclick="setTab4('fo',1,2)">详细说明</li>
							<li id="fo2" onclick="setTab4('fo',2,2)">产品评论</li>
						</ul>
					</div>
					<div class="fl_r view_fxpl">
						<span class="view_fx"><a href="javascript:share();">分享给好友</a></span><span class="view_pl"><a href="javascript:comment();">我要评论</a></span>
					</div>
				</div>
				<div class="view_p_in">
					<div id="con_fo_1">
						{$pr_info.pr_content}
					</div>
                    <a name="comment2"></a>
					<div id="con_fo_2" style="display:none;">
						<ul id="comment_list">
                           <volist name="prc_list" id="vo">
                             <li>
								<div class="pl_tit clearfix">
									<div class="fl_l pl_name">{$vo.comment_title}</div>
									<div class="fl_l pl_mail">来自：{$vo.email}</div>
									<div class="fl_l pl_data">{$vo.datetime}</div>
								</div>
								<div class="pl_con">{$vo.content}</div>
							</li>
                           </volist>
						</ul>
						<div class="pages_list" align="right" style="padding:0 10px 0 0;">
						<span id="divpage">{$divpage}</span>
				到第<input type="text" name="p" id="p" class="go_num">页<input type="button" value="确定" onclick="var p=document.getElementById('p').value; if(p==''||isNaN(p)){alert('请输入数字');return false;}else{ajax_divpage(p);}" class="go_btn">
						</div>
                        <a name="comment" id="comment"></a>
<div class="view_tjpl">
  <form id="form_comment" name="form_comment" method="post" action="__URL__/insert_prcomment/id/{$Think.get.id}">
								<table>
								<tr>
									<td valign="top" height="30">用户名：</td>
									<td valign="top"><input type="text" id="email" name="email" class="tjpl_text"><span class="tjpl_bx">*</span></td>
								</tr>
								<tr>
									<td valign="top" height="30">标题：</td>
									<td valign="top"><input type="text" name="comment_title"  id="comment_title" class="tjpl_text"><span class="tjpl_bx">*</span></td>
								</tr>
								<tr>
									<td valign="top" height="90">评论内容：</td>
									<td valign="top"><textarea name="content" name="content" rows="" cols="" class="tjpl_area"></textarea><span class="tjpl_bx">*</span></td>
								</tr>
								<tr>
									<td height="40">&nbsp;</td>
									<td><input type="submit"  id='btn_comment' name='btn_comment' value="提 交" onclick="return check_pr_comment(this.form);" class="tjpl_btn"></td>
								</tr>
								</table>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- layout::Home:Public:bottom::-1 -->
</body>
</html>